#! /usr/bin/env python
# -*- coding: utf-8 -*-
import decimal


def decimal_default(obj):
    if isinstance(obj, decimal.Decimal):
         return float(obj)
    raise TypeError
